﻿<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
	{include file="Public/header"/}
	<link rel="stylesheet" type="text/css" href="/Hui/icheck/icheck.css">
	<title>节点添加</title>
</head>
<body>
<article class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>标题：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" id="title" name="title">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">链接：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" name="name" id="roleName">
			</div>
		</div>
		{$tree_list}
		<input type="hidden" name="module" value="admin">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">是否为菜单：</label>
			<div class="mt-20 skin-minimal">&nbsp;&nbsp;
				<div class="radio-box">
					<input type="radio" id="radio-1-m" name="type" value="2" checked>
					<label for="radio-1-m">是</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="radio-2-m" name="type" value="1" >
					<label for="radio-2-m">否</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">显示隐藏：</label>
			<div class="mt-20 skin-minimal">&nbsp;&nbsp;
				<div class="radio-box">
					<input type="radio" id="radio-1-d" name="hide" value="0">
					<label for="radio-1-d">是</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="radio-2-d" name="hide" value="1" checked>
					<label for="radio-2-d">否</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">仅开发者模式可见：</label>
			<div class="mt-20 skin-minimal">&nbsp;&nbsp;
				<div class="radio-box">
					<input type="radio" id="radio-1" name="is_dev" value="1">
					<label for="radio-1">是</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="radio-2" name="is_dev" value="0" checked>
					<label for="radio-2">否</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">图标：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" id="condition" name="condition">
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input type="hidden" name="status" value="1"> <!-- 默认添加有效 -->
				<button type="submit" class="btn btn-success radius" id="admin-role-save"><i class="icon-ok"></i> 确定</button>
			</div>
		</div>
	</form>
</article>

{include file="Public/footer" /}

<!--请在下方写此页面业务相关的脚本-->
{include file="Public/expand-js" /}
<script type="text/javascript">
$(function () {
    //单选框
    $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });

    //表单验证
    $("#form-add").validate({
        rules:{
            title:{
                required:true,
            },
            name:{
                required:true,
            },
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
            var data = $('#form-add').serialize();
            $(form).ajaxSubmit(function(data){
                if(data.code)
                {
                    layer.msg(data.msg);
                    setTimeout(function(){
                        window.parent.location.reload();
                        window.location=data.opt.url;
                    }, 2000);
                } else {
                    layer.msg(data.msg);
                }
            });
        }
    })
})
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>